import * as THREE from "three"

export default class Light {
    static spotMainLight() {
        const bigSpotLight = new THREE.SpotLight(0xffffff, 500, 30, Math.PI / 8, 0.2, 2)
        bigSpotLight.position.set(0, 10, 0);
        bigSpotLight.target.position.set(0, 0, 0);
        bigSpotLight.castShadow = true
        bigSpotLight.visible = true
        bigSpotLight.shadow.bias = -0.05;  // 调整阴影偏差
        return [bigSpotLight, bigSpotLight.target];
    }

    static spotFlashLight() {
        const spotLight = new THREE.SpotLight(0xffffff, 10, 100, 0.3, 0.25, 1)
        spotLight.position.set(0, 15, 0);
        spotLight.castShadow = false;
        spotLight.target.position.set(0, 0.2, 0);
        spotLight.visible = true
        return [spotLight, spotLight.target];
    }

    static ambientLight () {
        const ambientLight = new THREE.AmbientLight(0xffffff);
        ambientLight.intensity = 2;
        return ambientLight;
    }

    static directionalLight() {
        const directionalLight = new THREE.DirectionalLight(0xFFFFFF, 3)
        directionalLight.position.set(-1, 1, 1)
        directionalLight.castShadow = false
        return directionalLight
    }

    static rectAreaLight() {
        var width = 10;
        var height = 10;
        var intensity = 1;
        var rectLight = new THREE.RectAreaLight( 0xffffff, intensity,  width, height );
    }

    static hemisphereLight() {
        const hemisphereLight = new THREE.HemisphereLight( 0xffffff, 0x000000, 2 );
        return hemisphereLight;
    }

} 